<template>
    <view>
        <view class="title">上货次数：{{recordList.length}}次</view>
        <view class="datePicker">
            <view>开始时间：</view>
            <view class="dateTime">
                <picker mode="date" :value="startDate" :end="endDate" @change="startDateChange">
                    <view class="uni-input">{{startDate}}</view>
                </picker>
            </view>
            <image src="/static/icons/right.png"></image>
        </view>
        <view class="datePicker">
            <view>结束时间：</view>
            <view class="dateTime">
                <picker mode="date" :value="endDate" :end="endDate" @change="endDateChange">
                    <view class="uni-input">{{endDate}}</view>
                </picker>
            </view>
            <image src="/static/icons/right.png"></image>
        </view>
        <view class="title">
            <view>上货设备</view>
            <view>上货</view>
            <view>下货</view>
            <view>上货时间</view>
        </view>
        <view class="lists">
            <block v-for="(item, index) in recordList">
                <view class="list" @click="showTable(index)">
                    <view>{{item.deviceId}}</view>
                    <view>{{item.addCount}}</view>
                    <view>{{item.subCount}}</view>
                    <view>
                        <view>{{item.createDate}}</view>
                        <view>{{item.createTime}}</view>
                    </view>
                </view>
                <view class="table" v-if="item.showTable">
                    <view class="rows">
                        <view class="cols">商品名称</view>
                        <view class="cols">上下货数量</view>
                        <view class="cols">上货员</view>
                    </view>
                    <view class="rows" v-for="(item2, index) in item.detail">
                        <view class="cols">{{item2.name}}</view>
                        <view class="cols">{{item2.count}}</view>
                        <view class="cols">{{item.courierName}}</view>
                    </view>
                    <view class="none" v-if="item.detail.length == 0">无记录</view>
                </view>
            </block>

            <!-- <view class="list">
				<view>B127</view>
				<view>196</view>
				<view>0</view>
				<view>
					<view>2016-12-12</view>
					<view>16:23:12</view>
				</view>
			</view>
			<view class="list">
				<view>B127</view>
				<view>196</view>
				<view>0</view>
				<view>
					<view>2016-12-12</view>
					<view>16:23:12</view>
				</view>
			</view> -->
        </view>
        <view class="noMore" v-if="recordList.length == 0 || noMore">没有更多啦</view>
        <view class="footer">
            <view class="contents">
                <view class="nav" @click="home">
                    <image src="/static/icons/home.png"></image>
                    <view>首页</view>
                </view>
                <view class="nav" @click="stock">
                    <image src="/static/icons/stock.png"></image>
                    <view>上货库存</view>
                </view>
                <view class="nav">
                    <image src="/static/icons/record2.png"></image>
                    <view style="color: #FFD700;">上货记录</view>
                </view>
                <view class="nav" @click="personal">
                    <image src="/static/icons/personal.png"></image>
                    <view>个人中心</view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
    import record from "./record.js";

    export default record;
</script>

<style>
    @import url("./record.css");
</style>